<?php
class SRDO_DataObjectField {
	public $value;

	public function __construct(&$value, $type = null) {
		$this->value = &$value;

		if ($type) {
			if ( isset(SRDO::$config['type'][$type]['var']) ) {
				foreach ( array_keys(SRDO::$config['type'][$type]['var']) AS $k ) {
					$this->{$k} = &SRDO::$config['type'][$type]['var'][$k];
				}
			}
		}
	}

	public function isValid() {
		if ( isset($this->validate) ) {
			// Do some hooplah
			return preg_match($this->validate, $this->value);
		}

		return null;
	}
}